<?php
use yii\bootstrap\ActiveForm;

?>

<style>
	.itemList .item-name{width: 70px;}
	input[type="text"]{padding-left: 10px;}
	input[type="reset"] {background-color:#999;}
	.navbar{
		display: none;
	}

	.myclass .n-icon{
		display: none !important;
	}
	.form_position{
		position: relative;
		top:40px;
		margin: 0 80px;
	}
	.form-group{
		padding-bottom:22px;
		margin-bottom: 5px;
	}
	.tab_position{
		left: 80px;
	}

</style>

<div class="container mt20 form_position">
			<?php $form=ActiveForm::begin(['id'=>'myform','options'=>['name'=>'register']]);?>
				<ul class="add_user">
					<li class="itemList clearfix form-group">
						<span class="item-name">店长账号</span>
						<div class="item-txt">
							<input type="text" name="user_name" />
							<span class="red">*</span>
						</div>
					</li>
					<li class="itemList clearfix form-group">
						<span class="item-name">账户密码</span>
						<div class="item-txt">
							<input type="text" name="user_pass"  />
							<span class="red">*</span>
						</div>
					</li>
					<li class="itemList clearfix form-group">
						<span class="item-name">分店名称</span>
						<div class="item-txt">
							<input type="text" name="shop_name" value=""/>
							<span class="red">*</span>
						</div>
					</li>
					<li class="itemList clearfix form-group">
						<span class="item-name">联系电话</span>
						<div class="item-txt">
							<input type="text" name="phone" id="time" />
						</div>
					</li>
				</ul>
			<div  class="tab_position">
				 <span class="btnBg" style="width: 92px; height: 32px;line-height: 32px;">
			 		 <input type="submit" value="确定" style="display: inline-block; width: 100%; background: 0; border: 0 ;padding: 0" /></span>
		 		 <span class="btnBg bg_rest ml20" style="width: 92px; height: 32px;line-height: 32px;">
			     <input type="reset" value="取消"  class="rest" style="display: inline-block; width: 100%; background: 0; border: 0;padding: 0"/></span>
			</div>

			<?php ActiveForm::end();?>
		</div>
<?php $this->beginBlock('js_index') ?>

$('form[name="register"]').validator({
focusCleanup: true,
stopOnError:false,
//debug: true,
timely: 2,
//自定义规则（PS：建议尽量在全局配置中定义规则，统一管理）
rules: {
length:[/^\S{1,20}$/, '请填写1到20个字符']
},
msgClass: "n-bottom myclass",
fields: {
'user_name':{
rule:"required;mobile",
msg:{
required: "不能为空!",
}
},
'user_pass':{
rule:"required;password;",
msg:{
required: "不能为空!",
}
},
'shop_name':{
rule:"required;length;",
msg:{
required: "不能为空!",
}
},

'phone':{
rule:"mobile;",
msg:{
required: "不能为空!",
}
},
}

});
$('input[type="reset"]').click(function(){
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
})

<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['js_index'], $this::POS_END); ?>
